package com.linlin.blog.bloguser.config;import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;import org.apache.ibatis.reflection.MetaObject;import org.springframework.context.annotation.Primary;import org.springframework.stereotype.Component;import java.util.Date;/** * 持久层数据自动填充配置 */@Primary@Component(value = "myMetaObjectHandlerByAdmin")public class MyMetaObjectHandler implements MetaObjectHandler {    //插入时自动填充字段    @Override    public void insertFill(MetaObject metaObject) {        strictInsertFill(metaObject,"createTime", Date::new,Date.class);        strictInsertFill(metaObject,"updateTime",  Date::new,Date.class);        strictInsertFill(metaObject,"delFlag",()->0,Integer.class);    }    //更新时自动填充字段    @Override    public void updateFill(MetaObject metaObject) {        strictInsertFill(metaObject, "updateTime", Date::new, Date.class);    }}